// app.js
import {IP} from './utils/constData'

App({
  onLaunch() {
    // 展示本地存储能力
    // const logs = wx.getStorageSync('logs') || []
    // logs.unshift(Date.now())
    // wx.setStorageSync('logs', logs)
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
        wx.request({
          url: IP + '/wx/user/login',
          data: {
            wxCode: res.code
          },
          success(result) {
            let data = result.data;
            if (data.code == "200") {
              wx.setStorageSync("token", data.data.token);
            }
          }
        })
      }
    })

  },
  globalData: {
    userInfo: null,
    //收支选中标签name
    shouzhiTab:'zhichu',
    // 借贷选择标签name
    jiedaiTab:'jiekuan',
  },

})